package com.zbkj.crmeb.front.controller;

import com.common.CommonResult;
import com.zbkj.crmeb.block.service.BlockService;
import com.zbkj.crmeb.statistics.service.HomeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("api/front/user/wallet")
@Api(tags = "用户 -- 钱包")
public class WalletController {
    @Autowired
    private HomeService homeService;

    @Autowired
    private BlockService blockService;
    /**
     * 用户曲线图
     * @author Mr.Zhang
     * @since 2020-05-16
     */
    @ApiOperation(value = "增值趋势")
    @RequestMapping(value = "/chart/increment", method = RequestMethod.GET)
    public CommonResult<Map<Object, Object>> chartIncrement(){
        return CommonResult.success(homeService.chartIncrement());
    }

    @ApiOperation(value = "当前价格")
    @RequestMapping(value = "/token/price", method = RequestMethod.GET)
    public CommonResult<BigDecimal> currentPrice(){
        return CommonResult.success(blockService.getCurrentPrice());
    }


}
